/**
 *
 */
package com.ssyt.examinationsystem.service.impl;

import com.ssyt.examinationsystem.dao.IExamDAO;
import com.ssyt.examinationsystem.dao.impl.ExamDAOImpl;
import com.ssyt.examinationsystem.service.IExamService;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * @author Administrator
 */
public class ExamServiceImpl implements IExamService {

    // 创建试卷业务对象
    IExamDAO examDao = new ExamDAOImpl();

    @Override
    public List<String> getAnswersByIds(String ids, String tableName, String id) {

        List<String> answerList = new ArrayList<String>();

        List<Map<String, Object>> list = examDao.getAnswersByIds(ids, tableName, id);

        for (Map<String, Object> map : list) {
            answerList.add(String.valueOf(map.get("answer")));
        }

        return answerList;
    }
}
